package com.mybd.req.one;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * @author: Scq
 * @time: 2021/6/510:33
 */
public class MyMapper extends Mapper<LongWritable, Text, Text, NullWritable> {
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        String[] split = value.toString().split(",");
        if (!("null".equals(split[0]) || "".equals(split[0]))) {
            context.write(value, NullWritable.get());
        }
    }
}
